package com.ybkj.chat.module.dynamic.activity;

import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.RelativeLayout;

import com.androidkun.xtablayout.XTabLayout;
import com.ybkj.chat.R;
import com.ybkj.chat.base.BaseMvpActivity;
import com.ybkj.chat.manager.ActivityManager;
import com.ybkj.chat.module.dynamic.fragment.ClassifyCreatFragment;
import com.ybkj.chat.module.dynamic.fragment.PickCreatFragment;
import com.ybkj.chat.ui.adapter.ViewPagerAdapter;

import butterknife.BindView;

/**
 * 创建群聊9.5
 */
public class CreatGroupActivity extends BaseMvpActivity {
    @BindView(R.id.head_bottom_line)
    View headBottomLine;
    @BindView(R.id.commom_rl)
    RelativeLayout commomRl;
    @BindView(R.id.tl_tablayout)
    XTabLayout tab;
    @BindView(R.id.pager)
    ViewPager pager;

    private ViewPagerAdapter viewPagerAdapter;


    @Override
    protected void injectPresenter() {

    }

    @Override
    protected void initTitle() {
        setTitleText("创建群聊");
        setRightText("创建");
        setRightTextColor(R.color.color_dfd);
        setRightTextVisible(true);
    }

    @Override
    public void onRightTextClick() {
        super.onRightTextClick();
        ActivityManager.gotoActivity(mContext, EditGroupActivity.class);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_creat_group;
    }

    @Override
    protected void initView() {
        viewPagerAdapter = new ViewPagerAdapter(getSupportFragmentManager());
        tab.addTab(tab.newTab().setText("选人创建"));
        tab.addTab(tab.newTab().setText("按分类创建"));

        PickCreatFragment pickCreatFragment = new PickCreatFragment();
        ClassifyCreatFragment classifyCreatFragment = new ClassifyCreatFragment();
        viewPagerAdapter.addFragment(pickCreatFragment, "选人创建");
        viewPagerAdapter.addFragment(classifyCreatFragment, "按分类创建");
        pager.setAdapter(viewPagerAdapter);
        if (tab != null) {
            tab.setupWithViewPager(pager);
        }
    }

    @Override
    protected void initData() {

    }


}
